<template>
  <div class="swiperThumbs_cont">

    <!-- swiper -->
    <swiper :options="swiperOption">
      <swiper-slide v-for="item in swiperList" :style="'background:' + item" :key="item.id">
      </swiper-slide>
      <!-- 用于分页 -->
      <!-- <div class="swiper-pagination" slot="pagination"></div> -->
    </swiper>

    <!-- Thumbs -->
    <swiper class="gallery-thumbs" :options="swiperOptionThumbs">
      <swiper-slide v-for="item in swiperList" :style="'background:' + item" :key="item.id">
      </swiper-slide>
      <!-- 用于分页 -->
      <!-- <div class="swiper-pagination" slot="pagination"></div> -->
    </swiper>


  </div>
</template>

<script>
  export default {
    name: 'swiperThumbs',
    data() {
      return {
        swiperOption: {
          // 参数选项,显示小点
          // pagination: '.swiper-pagination',
          // 循环轮播
          loop: true,
          // 每张播放时长1秒，自动播放
          autoplay: 5000,
          // 滑动速度
          speed: 500
        },

        swiperOptionThumbs: {
          // centeredSlides: true,
          slidesPerView: 'auto',
          loop: true,
          touchRatio: 0.2,
          slidesPerView: 4,
          // slideToClickedSlide: true,
          watchSlidesVisibility: true,
        },
        swiperList: ["#000", "#999", "#333", "#aaa"]
      }
    },
    created() {},
    components: {},
    mounted() {}
  }
</script>

<style scoped="scoped">
  .swiper-slide {
    width: 100%;
    height: 4rem;
    background: ;
  }

  .swiper-container {
    --swiper-theme-color: #fff;
    /* 两种都可以 */
  }

  .gallery-thumbs .swiper-slide {
    height: 1rem;
  }

  .gallery-thumbs .swiper-wrapper{
    transform: translate3d(0px, 0px, 0px) !important;
    height: 999px;
  }
</style>
